package dataBase;


import java.util.Date;

import javax.jdo.annotations.*;

import com.google.appengine.api.datastore.Blob;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class Ad {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	@Persistent
	Blob adPic;
	@Persistent
	private String businessUserName; 
	@Persistent
	private String bizType;
	@Persistent
	private Date createDate;
	@Persistent
	private int clicked = 0;
	@Persistent
	private int appeared = 0;
	@Persistent
	private String link;

    public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}
	
	public void addClicked()
	{
		clicked+=1;
	}

	public void addAppeared()
	{
		appeared+=1;
	}

	public Blob getAdPic() {
		return adPic;
	}

	public void setAdPic(Blob adPic) {
		this.adPic = adPic;
	}

	public String getBusinessUserName() {
		return businessUserName;
	}

	public void setBusinessUserName(String businessUserName) {
		this.businessUserName = businessUserName;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public int getClicked() {
		return clicked;
	}

	public void setClicked(int clicked) {
		this.clicked = clicked;
	}

	public int getAppeared() {
		return appeared;
	}

	public void setAppeared(int appeared) {
		this.appeared = appeared;
	}

	public String getBizType() {
		return bizType;
	}

	public void setBizType(String bizType) {
		this.bizType = bizType;
	}

	
}